package com.yamanyar.weebill.view;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;

import com.yamanyar.weebill.domain.Component;
import com.yamanyar.weebill.service.ComponentService;

/**
 * Lists components. Created in Jun 28, 2008.
 * 
 * @author Kaan Yamanyar
 */
@org.springframework.stereotype.Component("listComponent")
@Scope("request")
public class ListComponents implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3156916209497186641L;
	private List<Component> components;
	private ComponentService componentService;

	@Autowired
	public ListComponents(ComponentService componentService) {
		this.componentService = componentService;
		components = this.componentService.findAll();
	}

	public List<Component> getComponents() {
		return components;
	}

	public void setComponents(List<Component> components) {
		this.components = components;
	}

}
